import React, { Component } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import * as actions from '../../actions/index'
import { Menu, Dropdown } from 'antd'
import { DownOutlined } from '@ant-design/icons'

// const menu = (
    
// )

class Top extends Component {

    correct() {
        this.props.Correct()
    }

    pour() {
        this.props.Pour()
    }

    render() {
        return (
            <div className='Top'>
                <Dropdown overlay={(
                    <Menu>
                    <Menu.Item>
                        <a href='' onClick={
                            this.correct.bind(this)
                        }>
                            正序
                        </a>
                    </Menu.Item>
                    <Menu.Item>
                        <a href='' onClick={
                            this.pour.bind(this)
                        }>
                            倒序
                        </a>
                    </Menu.Item>
                </Menu>
                )}>
                    <a onClick={e => e.preventDefault()}>
                        店铺名称 <DownOutlined />
                    </a>
                </Dropdown>
                <p>店铺地址</p>
                <p>店铺介绍</p>
                <p>操作</p>
            </div>
        )
    }
}

let mapStateToProps = ({ homeReducer }) => {
    return {
        ...homeReducer
    }
}

let mapDispatchToProps = (dispatch) => bindActionCreators(actions, dispatch)

export default connect(mapStateToProps, mapDispatchToProps)(Top)